//
//  CookBookLitleCollectionViewCell.m
//  Taste
//
//  Created by 徐昊 on 16/9/3.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "CookBookLitleCollectionViewCell.h"
#import "CookBookRes.h"
#import "UIImageView+WebCache.h"
#import "NSString+Vali.h"

@interface CookBookLitleCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *authorName;
@property (weak, nonatomic) IBOutlet UILabel *tColnum;
@property (weak, nonatomic) IBOutlet UIImageView *pic;
@property (weak, nonatomic) IBOutlet UIImageView *hasVideo;


@end

@implementation CookBookLitleCollectionViewCell

- (void)setRes:(CookBookRes *)res {
    _res = res;
    _title.text = _res.title;
    _authorName.text = _res.authorname;
    _tColnum.text = _res.tcolnum;
    if ([_res.has_video isEqualToString:@"1"]) {
        _hasVideo.alpha = 1;
    } else {
        _hasVideo.alpha = 0;
    }
    [_pic sd_setImageWithURL:[NSURL URLWithString:[NSString imageWebWithStr:_res.pic]] placeholderImage:[UIImage imageNamed:@"IMG_Universal_Placeholder"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        
    }];
}

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

@end
